#include "std.hpp"
#include "InternalDictionary.hpp"

// These are the ASCII codes for the printable chars we want to add on to the basic list.
// 33 TO 47, 91 TO 96, 123 TO 126, 128 TO 255
// 14        5         3           127
// 149

InternalDictionary::InternalDictionary()
{
FUNCTION
}

InternalDictionary::~InternalDictionary()
{
FUNCTION
}

bool InternalDictionary::searchForWord(const std::string line, const std::string word)
{
FUNCTION

  unsigned int offset = line.find(word, 0);
  if(offset != std::string::npos)
  {
    lastFoundOffset = offset;
    return true;
  }
  else
  {
    return false;
  }
}

bool InternalDictionary::proccessLine(std::string line)
{
FUNCTION

  std::string temporaryString;
  line += " ";
  temporaryString = line;
  line = " ";
  line += temporaryString;

  if(searchForWord(line, " yes ")) return true;
  if(searchForWord(line, " no ")) return true;
  if(searchForWord(line, " black ")) return true;
  if(searchForWord(line, " white ")) return true;
  if(searchForWord(line, " n0 ")) return true;
  if(searchForWord(line, " y3s ")) return true;
  if(searchForWord(line, " y35 ")) return true;
  if(searchForWord(line, " ye5 ")) return true;
  if(searchForWord(line, " b1ack")) return true;

  return false;
}
